# 作者: spy
# 开发时间: 2021/12/24 15:01

from common.excel_util import ExcelUtil
from base.base_util import BaseUtil
from pageobject.track_page import TrackMonitor
from ddt import ddt, data, unpack


@ddt  # 声明当前类使用ddt数据驱动
class TestTrackMonitor(BaseUtil):

    @data(*ExcelUtil().read_excel_TrackMonitor())  # 给函数传值  *解析外层的[]
    @unpack  # 解包列表或元组
    def test_03_TrackMonitor(self, index, trailer_ID):
        """ 轨迹监控 """
        pm = TrackMonitor(self.driver)
        pm.track_monitor(trailer_ID)

    @data(*ExcelUtil().read_excel_TrackMonitor())  # 给函数传值  *解析外层的[]
    @unpack  # 解包列表或元组
    def test_04_LocationSearch(self, index, trailer_ID):
        """ 地点查询 """
        pm = TrackMonitor(self.driver)
        pm.location_search(trailer_ID)

    @data(*ExcelUtil().read_excel_TrackMonitor())  # 给函数传值  *解析外层的[]
    @unpack  # 解包列表或元组
    def test_05_TrackPlayback(self, index, trailer_ID):
        """ 轨迹回放 """
        pm = TrackMonitor(self.driver)
        pm.track_playback(trailer_ID)


